#pragma once

#include <cstdint>
#include <string>
#include "Singleton.h"
#include "expire_def.h"
#include "account.h"


class AccountMgr
{
public:
    AccountMgr();
    virtual ~AccountMgr() = default;

public:
    static AccountMgr* Instance()
	{
		return CSingleton<AccountMgr>::Instance();
	}

public:
    stAccount* Get(const std::string& agency, const std::string& username);
	stAccount* Update(stAccount&& account);

protected:
    std::string Uuid(const std::string& agency, const std::string& username);

private:
    ExpireMgr<std::string, stAccount, 5*3600> m_accounts;  // 用户信息缓存5小时
};













